﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using Hong.Common.Encryption;
using Hong.Common.RabbitMQ;

namespace Hong.Common.AutofacConfig
{
    public class Autofac_Config:Autofac.Module
    {
        //Autofac注入
        protected override void Load(ContainerBuilder builder)
        {
            var Iassembly = Assembly.Load("Hong.IRepository");
            var Assembly_DAL = Assembly.Load("Hong.Repository");
            var Assembly_BLL = Assembly.Load("Hong.Business");
            builder.RegisterAssemblyTypes(Assembly_DAL, Iassembly).InstancePerDependency().AsImplementedInterfaces().AsSelf().PropertiesAutowired();
            builder.RegisterAssemblyTypes(Assembly_BLL);
            builder.RegisterType<RabbitMqConfig>();
            builder.RegisterType<SecurityStatic>();
        }
    }
}
